package io;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.ObjectInputStream;

public class ObjectInputStreamDemo02 {
    public static void main(String[] args) throws IOException, ClassNotFoundException
    {
        ObjectInputStream ois = new ObjectInputStream(new FileInputStream("d:/message.txt"));
        Message m = (Message)ois.readObject();
        System.out.println(m.getId()+","+m.getTitle()+","+m.getContent()+","+m.getAuthor());
        ois.close();
    }
}
